<?php
	error_reporting(0);
	function conn(){
		$conn = mysql_connect( "localhost", "root", "root");
		mysql_select_db("oa", $conn);
		mysql_query("set names utf8");
		return $conn;
	}
	
	$conn = conn();
	
	function info( $username ){
		global $conn;
		$i=0;
		$sql = "select * from oa_information where user_name='$username' and info_status=0";
		$result = mysql_query($sql, $conn);
		$num = mysql_num_rows($result);

		$data['num'] = $num;
		$data['type'] = "OA系统消息通知";
		$data['url'] = "https://oa.cc1990.com";
		mysql_query("update oa_information set info_status=1 where account='$username' and info_status=0");
		
		return json_encode($data);
	}
	
	
	require_once 'Soap/nusoap.php';//加载nusoap文件   
	$server = new nusoap_server();
	
	$server->soap_defencoding = 'UTF-8';
	//$ser->decode_utf8 = false;
	$server->xml_encoding = 'UTF-8';
	
	$server->configureWSDL('infowsdl', 'urn:infowsdl');
	$server->register('info',
            array('username'=>'xsd:string'),
	        array('return'=>'xsd:string'),
	        'urn:infowsdl',
	        'urn:infowsdl#info',
	        'rpc',
	        'encoded',
	        'info'
	 );
	
	$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
	$server->service($HTTP_RAW_POST_DATA);

?>